% Create Fresh Environment
close all
clear all
clc

fm = 20E3;          % Max Freq.
df = 2E3;           % Freq. Deviation
B = df/fm;          % Mod. Index
t=0:0.0001:0.1;     % Time Vector

fs = 48E3;
f = 20E3;
sec = 2;
n = 0:1:sec*fs;
y = 1*sin(2*pi*n*f/fs);

% % sound(y,fs)
% %plot(n,y)
% %xlim([0 2*882])
% % 
% recObj = audiorecorder(fs, 16, 1);
% 
% matlabpool open 2
% parfor i = 1:2
%     if i == 1
%         sound(y,fs);
%     else
%         recordblocking(recObj, 1/f); 
%     end
% end
% % Store data in double-precision array.
% myRecording = getaudiodata(recObj);
% 
% % Plot the waveform.
% plot(myRecording);